<template>
  <el-form :model="traceCarQueryParam" ref="traceCarForm" :inline="true" label-width="72px" :label-position="'left'">
    <el-row class="search-title">条件搜索</el-row>
    <el-form-item prop="plateNo">
      <el-input v-model="traceCarQueryParam.plateNo" prefix-icon="el-icon-search" clearable
                placeholder="车牌号"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button class="btn-search" type="primary" @click="queryForm">搜索
      </el-button>
    </el-form-item>
    <collapse-vertical>
      <div v-show="isDisplay">
        <el-row>
          <el-form-item prop="plateColor" label="车牌颜色">
            <el-radio-group v-model="traceCarQueryParam.plateColor" size="small">
              <el-radio v-for="item in plateColors" :label="item.id" style="color: white">{{item.value}}</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item prop="traceType" label="追踪类型">
            <el-radio-group v-model="traceCarQueryParam.traceType" size="small">
              <el-radio v-for="item in trackCategorys" :label="item.id" style="color: white">{{item.value}}</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item prop="parkNo" label="追踪地点">
            <el-input clearable placeholder="追踪地点" v-model="traceCarQueryParam.parkNo"></el-input>
          </el-form-item>
        </el-row>
        <el-form-item prop="start" label="日期范围">
          <el-date-picker v-model="traceCarQueryParam.start" type="date" placeholder="选择日期" format="yyyy年MM月dd日"
                          value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button class="btn-mini-form" @click="queryForm" type="primary" style="color: white"
                     size="mini">提交
          </el-button>
          <el-button class="btn-mini-form" @click="resetForm" type="primary" style="color: white"
                     size="mini">重置
          </el-button>
        </el-form-item>
      </div>
    </collapse-vertical>
    <el-row style="text-align: center">
      <el-button style="border: none;background-color: transparent" size="small"
                 @click="isShow" :icon="isDisplay?'el-icon-arrow-up':'el-icon-arrow-down'">
      </el-button>
    </el-row>
  </el-form>
</template>

<script>
  /* eslint-disable */
  import CollapseVertical from '../../../utils/collapseVertical';

  export default {
    components: {
      CollapseVertical
    },
    name: "track-car-form",
    data() {
      return {
        isDisplay: false,
        plateColors: [
          {id: 0, value: '白'},
          {id: 1, value: '黄'},
          {id: 2, value: '蓝'},
          {id: 3, value: '黑'},
          {id: 4, value: '绿'},
          {id: 9, value: '其他颜色'},
        ],
        trackCategorys: [
          { id: 1, value: '嫌疑车' },
          { id: 2, value: '脱审车' },
          { id: 3, value: '套牌车' },
          { id: 4, value: '欠费车' }
        ],
        traceCarQueryParam: {
          end: null,
          parkNo: null,
          plateColor: null,
          plateNo: null,
          start: null,
          traceType: null
        }

      }
    },
    methods: {
      queryForm() {
        this.$emit('handleQueryTrace', this.traceCarQueryParam)
      },
      resetForm() {
        this.$refs['traceCarForm'].resetFields()
      },
      isShow() {
        this.isDisplay = !this.isDisplay
      }
    }
  }
</script>

<style scoped>

</style>
